package com.ruoyi.hxf.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.hxf.domain.Education;
import com.ruoyi.hxf.domain.Topic;
import org.apache.ibatis.annotations.Param;

/**
 * 帖子创建管理Mapper接口
 *
 * @author hxf
 * @date 2023-1-18
 */
public interface TopicMapper extends BaseMapperPlus<TopicMapper, Topic, Topic> {
    /**
     * 新增帖子信息
     *
     * @param topic 帖子信息
     * @return 结果
     */
    int insertTopic(Topic topic);

    Page<Topic> selectPageAndUser(@Param("page")Page<Topic> build,@Param(Constants.WRAPPER) Wrapper<Topic> lqw);

    Topic selectTopicById(@Param("topicId") String topicId);

    int updateByTopic(Topic topic);

    String selectCollectionByUserIdAndTopicId(@Param("userId") Long userId,@Param("topicId")  Long topicId,@Param("type")String type);

    int insertTopicLike(@Param("topicId")String topicId,@Param("userId") String userId,@Param("status") String status,@Param("type")String type);

    boolean selectTopicLike(@Param("topicId")String topicId,@Param("userId") String userId,@Param("type")String type);

    void updateTopicLike(@Param("topicId")String topicId,@Param("userId") String userId,@Param("status") String status,@Param("type")String type);

    int updateTopicByTopicId(Topic topic);

//    Page<Topic> selectPageAndUser(@Param("page") Page<Topic> build,@Param(Constants.WRAPPER) LambdaQueryWrapper<Topic> lqw);
}
